<?php

namespace app\admin\validate;

use think\Validate;

class Goods extends Validate
{
    protected $rule = [
        'good_img' => 'require',
        'good_id' => 'require',
        'good_name' => 'require',
        'good_price' => 'require',
        'good_stock' => 'require',
        'stock' => 'require',
        'addtime' => 'require',
        'state' => 'require',
    ];
    protected $message = [
        'good_img.require' => '商品图片不能为空',
        'good_id.require' => '商品编号不能为空',
        'good_name.require' => '商品名称不能为空',
        'good_price.require' => '商品价格不能为空',
        'good_stock.require' => '商品库存不能为空',
        'stock.require' => '可用库存不能为空',
        'addtime.require' => '添加时间不能为空',
    ];
    protected $scene = [
        'goods' => ['good_img', 'good_id', 'good_name',
            'good_price', 'good_stock', 'stock', 'addtime'
        ]
    ];
}